﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Entidades;
using System.Configuration;

namespace Manager.App_code
{
    public static class Rutinas
    {        
        public static List<ServerNode> LevantarConfiguracionAgentes()
        {
            ServerNode serv = null;
            List<ServerNode> lstServidores = new List<ServerNode>();
            if (ConfigurationSettings.AppSettings["Agente1"] != null)
            {
                serv = new ServerNode("Agente1");
                serv.URL = ConfigurationSettings.AppSettings["Agente1"];
                lstServidores.Add(serv);
            }
            if (ConfigurationSettings.AppSettings["Agente2"] != null)
            {
                serv = new ServerNode("Agent2");
                serv.URL = ConfigurationSettings.AppSettings["Agente2"];
                lstServidores.Add(serv);
            }
            if (ConfigurationSettings.AppSettings["Agente3"] != null)
            {
                serv = new ServerNode("Agent3");
                serv.URL = ConfigurationSettings.AppSettings["Agente3"];
                lstServidores.Add(serv);
            }
            if (ConfigurationSettings.AppSettings["Agente4"] != null)
            {
                serv = new ServerNode("Agent4");
                serv.URL = ConfigurationSettings.AppSettings["Agente4"];
                lstServidores.Add(serv);
            }
            if (ConfigurationSettings.AppSettings["Agente5"] != null)
            {
                serv = new ServerNode("Agent5");
                serv.URL = ConfigurationSettings.AppSettings["Agente5"];
                lstServidores.Add(serv);
            }
            return lstServidores;
        }
    }
}
